function gp = startEpisode(p,gp,sens,action,n)
% gpSARSA first episode
%
% tobias siegfried, 10/08/2008

% init
gp.sigma2 = p.sigma^2;

gp.alpha = zeros(0,1);
gp.a = ones(1,1);
gp.C = zeros(0,0);
gp.Kinv = [];
gp.z = zeros(0,1);
gp.kt = zeros(0,1);
gp.dict = [];

%gp.alpha = 0;
%gp.a = 1;
%gp.C = 0;
%gp.Kinv = [];
%gp.z = 0;
%gp.kt = 0;
%gp.dict = [];

% body
%gp.c = zeros(gp.currDSize);
gp.c = zeros(0,1);
gp.d = 0;
gp.s = inf;
gp.ktt = kernel(p,sens,sens,action,action);
gp.delta = gp.ktt;
gp.Kinv = 1/gp.ktt;
gp.h = [gp.a; -p.gamma(n)];
gp.a = [gp.z; 1];
gp.alpha = [gp.alpha; 0];
f = [gp.C ;gp.z'];
gp.C = [f zeros(size(f,1),1)];
gp.z = [gp.z; 0];
gp.c = [gp.c; 0];
gp.dict = updateD(gp,sens,action);
gp.kt = [gp.kt; gp.ktt]; 



